package org.dromara.system.controller;

import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.domain.bo.WbPowerCircleBo;
import org.dromara.system.domain.dto.NumDTO;
import org.dromara.system.domain.vo.WbPowerCircleVo;
import org.dromara.system.service.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system")
public class WbNumController extends BaseController {
    private final IWbPowerCircleService wbPowerCircleService;
    private final ISysUserService userService;
    private final IWbCandidateInfoService wbCandidateInfoService;
    private final IWbItemInfoService wbItemInfoService;
    private final IWbMinuteBidBagService wbMinuteBidBagService;

    /**
     *
     */
    @GetMapping("/num")
    public R<Map<String,Object>> num() {
        Map<String,Object> map = new HashMap<>();
        // 电力圈未审核文章数量
        List<NumDTO> PowerCircleNum = wbPowerCircleService.countNum();
        map.put("PowerCircleNum",PowerCircleNum);
        // 小程序用户数量
        List<NumDTO> userNum = userService.countNum();
        map.put("userNum",userNum);
        // 招标公告草稿、正文等其他数量
        List<NumDTO> itemNum = wbItemInfoService.countNum();
        map.put("itemNum",itemNum);
        // 推荐候选人 草稿、正文等其他数量
        List<NumDTO> CandidateNum = wbCandidateInfoService.countNum();
        map.put("CandidateNum",CandidateNum);
        //中标  草稿、正文等其他数量
        List<NumDTO> MinuteBidBagNum = wbMinuteBidBagService.countNum();
        map.put("MinuteBidBagNum",MinuteBidBagNum);
        return R.ok(map);
    }


}
